﻿using UnityEngine;
using System.Collections;

public class Wander : MonoBehaviour {
	private Vector3 location;
	public Unit u;
	private int counter=0;
	// Use this for initialization
	void Start () {
		location=u.obj.transform.position;
		u.target(location);
	}
	
	// Update is called once per frame
	void Update () {
		if(counter++<3000){
			u.target(location+Random.insideUnitSphere*20);
			counter=0;
		}
	}
}
